@extends('layouts.app')

@section('title', '用户列表')

@section('css-import')
<style type="text/css">
	.page-s{
		display: inline-block;
		padding-bottom: 0px;
		margin: 29px 9px;
		border-radius: 4px;
		float:  right;
	}
</style>
@endsection

@section('content-fluid')
<div class="row">
	<!-- BASIC TABLE -->
	<div class="panel">
		<div class="panel-heading">
			<h3 class="panel-title">乐享餐饮商户账号</h3>
		</div>
		<div class="panel-body">
			<ul class="nav nav-pills" style="float:left;">
			  <li role="presentation" class="orderall">
			  	<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
			      搜索条件 <span class="caret"></span>
			    </a>
			    <ul class="dropdown-menu">
			      <li role="presentation" class="yiqucan"><a href="">昵称</a></li>
			      <li role="presentation" class="weiqucan"><a href="">手机号</a></li>
			    </ul>
			  </li>
			</ul>
			<table class="table table-hover">
				<thead>
					<tr>
						<th>#</th>
						<th>昵称</th>
						<th>手机号</th>
						<th>账户余额</th>
						<th>积分</th>
						<th>注册时间</th>
						<th>购卡次数</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					@foreach($users as $k=>$v)
					<tr>
						<td>{{$v->user_id}}</td>
						<td>{{$v->nicename ?? '未填写'}}</td>
						<td>{{$v->tel}}</td>
						<td>{{$v->account}}</td>
						<td>{{$v->integral}}</td>
						<td>{{date('Y年m月d日 H:i',$v->insert_time)}}</td>
						<td>{{$card->orderCount($v->user_id)}}</td>
						<td>
							<a href="/user-details?userid={{$v->user_id}}"><i class="fa fa-info-circle"></i> 查看</a>
						</td>
					</tr>
					@endforeach
				</tbody>
			</table>
			{{$users->links()}}
			<div class="page-s">本页共{{ $users->count() }}条</div>
			<div class="page-s">共{{ $users->total() }}条</div>
			<div class="page-s">当前第{{ $users->currentPage() }}页</div>
			<div class="page-s">共{{ $users->lastPage() }}页</div>
		</div>
	</div>
	<!-- END BASIC TABLE -->
</div>

@endsection